import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get_utils/src/extensions/widget_extensions.dart';
import 'package:pornhub_app/components/app_bg_view.dart';
import 'package:pornhub_app/generate/app_image_path.dart';
import 'package:pornhub_app/utils/extension.dart';

import '../../../assets/styles.dart';
import '../../../utils/color.dart';

class SetPwdSuccessPop extends StatefulWidget {
  final VoidCallback? tap;

  const SetPwdSuccessPop({super.key, this.tap});

  @override
  State<StatefulWidget> createState() {
    return ChangeAppIconState();
  }
}

// ignore: camel_case_types
class ChangeAppIconState extends State<SetPwdSuccessPop> {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 300.w,
      height: 235.w,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(12),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Text("应用锁设置成功",
                  style: kTextStyle(COLOR.color_333333,
                      fontsize: 16.w, weight: FontWeight.w600))
              .marginOnly(top: 15.w),
          Container(
                  height: 1.w,
                  width: double.infinity,
                  color: COLOR.hexColor("#F0F0F0"))
              .marginOnly(top: 15.w),
          Text("开启应用锁后，下次打开APP即可生效",
                  style: kTextStyle(COLOR.color_333333,
                      fontsize: 12.w, weight: FontWeight.w600))
              .marginOnly(top: 10.w),
          Text("*卸载APP后重新下载，应用锁将会消失",
                  style: kTextStyle(COLOR.color_333333,
                      fontsize: 12.w, weight: FontWeight.w600))
              .marginOnly(top: 5.w),
          Text("*若更换设备，应用锁在新的设备会失效",
                  style: kTextStyle(COLOR.color_333333,
                      fontsize: 12.w, weight: FontWeight.w600))
              .marginOnly(top: 5.w),
          Text("*请牢记密码，如若忘记，请卸载后重新安装",
                  style: kTextStyle(COLOR.color_DC143C,
                      fontsize: 12.w, weight: FontWeight.w600))
              .marginOnly(top: 10.w),
          const Expanded(child: SizedBox()),
          Center(
            child: InkWell(
              onTap: (() {
                if (widget.tap != null) {
                  widget.tap!();
                }
              }),
              child: AppBgView(
                alignment: Alignment.center,
                width: 166.w,
                height: 36.w,
                imagePath: AppImagePath.mine_img_setpwd_btn,
                child: Text(
                  "设置完成返回上级",
                  style: TextStyle(
                      color: COLOR.hexColor("#fff"),
                      fontSize: 16.w,
                      fontWeight: FontWeight.w600),
                ),
              ).marginBottom(15.w),
            ),
          ),
        ],
      ),
    );
  }
}
